from django.db import models

# Create your models here.


class PoetModel(models.Model):
    SEX = ((1,'男'),(2,'女'))
    name = models.CharField(max_length=10)
    sex = models.IntegerField(choices=SEX)

    def __str__(self):
        return self.name + " - " + self.get_sex_display()


class PoemModel(models.Model):
    title = models.CharField(max_length=50)
    content = models.CharField(max_length=1000)
    author = models.ForeignKey(PoetModel, on_delete=models.DO_NOTHING)

    def __str__(self):
        return self.title